package com.ad.pet.common.structure.presenter.search;


import com.ad.pet.common.data.injector.PerActivity;
import com.ad.pet.common.structure.mvp.AbsBasePresenter;
import com.ad.pet.models.remote.MailList;

import java.util.List;

import javax.inject.Inject;


/**
 * Created by z on.
 * Des:搜索通讯录
 * Date: 2017/4/14
 */
@PerActivity
public class SearchNumberPresenter extends AbsBasePresenter implements SearchNumberContract.Presenter {

    SearchNumberContract.View mView;
    @Inject
    public SearchNumberPresenter() {
    }

    @Override
    public void onCreate(SearchNumberContract.View view) {
        mView = view;
    }

    @Override
    public void onDestroy() {
        mView = null;
    }


    @Override
    public void searchNumber(List<MailList> datas, final String obj) {
        //模糊查询
//        mSubscribe = Observable.from(datas).filter(new Func1<MailList, Boolean>() {
//            @Override
//            public Boolean call(MailList number) {
//
//            }
//        }).observeOn(AndroidSchedulers.mainThread()).subscribe(new Subscriber<MailList>() {
//            @Override
//            public void onCompleted() {
//                mView.searchComplete(result);
//            }
//
//            @Override
//            public void onError(Throwable e) {
//                e.printStackTrace();
//                String msg = ExceptionHandle.handle(e);
//                mView.error(msg);
//            }
//
//            @Override
//            public void onNext(MailList number) {
//                result.add(number);
//            }
//        });
    }
}
